<?php

namespace App\Http\Resources;

use App\Models\BookType;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Support\Str;

class BookTypeResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param \Illuminate\Http\Request $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'id' => (int)$this->id,
            'name' => $this->name,
            'ico' => $this->ico,
            'model_id' => $this->model_id,
            'sort' => $this->sort,
            'status' => $this->status,
            'pid' => $this->pid,
        ];
    }
}
